package com.ruoyi.pressure.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.pressure.domain.KyLaneDblc;
import com.ruoyi.pressure.service.IKyLaneDblcService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 顶板离层测点基本信 息数据项说明Controller
 * 
 * @author ruoyi
 * @date 2024-11-04
 */
@RestController
@RequestMapping("/pressure/dblc")
public class KyLaneDblcController extends BaseController
{
    @Autowired
    private IKyLaneDblcService kyLaneDblcService;

    /**
     * 查询顶板离层测点基本信 息数据项说明列表
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:list')")
    @GetMapping("/list")
    public TableDataInfo list(KyLaneDblc kyLaneDblc)
    {
        startPage();
        List<KyLaneDblc> list = kyLaneDblcService.selectKyLaneDblcList(kyLaneDblc);
        return getDataTable(list);
    }

    /**
     * 导出顶板离层测点基本信 息数据项说明列表
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:export')")
    @Log(title = "顶板离层测点基本信 息数据项说明", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, KyLaneDblc kyLaneDblc)
    {
        List<KyLaneDblc> list = kyLaneDblcService.selectKyLaneDblcList(kyLaneDblc);
        ExcelUtil<KyLaneDblc> util = new ExcelUtil<KyLaneDblc>(KyLaneDblc.class);
        util.exportExcel(response, list, "顶板离层测点基本信 息数据项说明数据");
    }

    /**
     * 获取顶板离层测点基本信 息数据项说明详细信息
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:query')")
    @GetMapping(value = "/{laneDblcId}")
    public AjaxResult getInfo(@PathVariable("laneDblcId") String laneDblcId)
    {
        return success(kyLaneDblcService.selectKyLaneDblcByLaneDblcId(laneDblcId));
    }

    /**
     * 新增顶板离层测点基本信 息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:add')")
    @Log(title = "顶板离层测点基本信 息数据项说明", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody KyLaneDblc kyLaneDblc)
    {
        return toAjax(kyLaneDblcService.insertKyLaneDblc(kyLaneDblc));
    }

    /**
     * 修改顶板离层测点基本信 息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:edit')")
    @Log(title = "顶板离层测点基本信 息数据项说明", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody KyLaneDblc kyLaneDblc)
    {
        return toAjax(kyLaneDblcService.updateKyLaneDblc(kyLaneDblc));
    }

    /**
     * 删除顶板离层测点基本信 息数据项说明
     */
    @PreAuthorize("@ss.hasPermi('pressure:dblc:remove')")
    @Log(title = "顶板离层测点基本信 息数据项说明", businessType = BusinessType.DELETE)
	@DeleteMapping("/{laneDblcIds}")
    public AjaxResult remove(@PathVariable String[] laneDblcIds)
    {
        return toAjax(kyLaneDblcService.deleteKyLaneDblcByLaneDblcIds(laneDblcIds));
    }
}
